<template>
  <div class="picture">
    <h2>我是Picture组件</h2>
    <button>获取一张随机的图片</button><br>
    <img v-for="(item,index) in imgList" :key="index" :src="item">
  </div>
</template>

<script>
  import { mapState } from 'vuex'

  export default {
    name:'Picture',
    computed:{
      ...mapState(['imgList'])
    }
  }
</script>

<style scoped>
  .picture {
      background-color: skyblue;
      padding: 10px;
      border-radius: 10px;
      box-shadow: 0 0 10px black;
  }
  img {
    margin-top: 10px;
    width: 100px;
    margin-right: 5px;
  }
</style>